/*
 * LC_DataStructs.h
 * This file contains the basic header information required for the RDC messages.
 *
 */

#ifndef __INCLUDE_LIGHTCONTROLLER_TYPES_H__
#define __INCLUDE_LIGHTCONTROLLER_TYPES_H__

#include "RDC_DataStructs.h"

/* The RDC can return multiple discrete bits in a single UINT32.  This defines
 *   a mask which is used to isolate the specific bits that are configured for
 *   the light controller's discretes 
 */
#define SWITCH_STATUS_BIT 0x0001
#define LIGHT_STATUS_BIT  0x0001
#define LIGHT_COMMAND_BIT 0x0001

#define LC_LIGHT_MODE_OFF 0x0000
#define LC_LIGHT_MODE_ON  LIGHT_COMMAND_BIT

#define LC_SWITCH_STATUS_OFF 0x0000
#define LC_SWITCH_STATUS_ON  SWITCH_STATUS_BIT

#define LC_LIGHT_STATUS_OFF 0x0000
#define LC_LIGHT_STATUS_ON  LIGHT_STATUS_BIT

/* Types*/

/* The following data structures were defined for the specific components of
    the Light Controller demonstration system */
    
typedef struct LC_DISCRETE_OUTPUT_COMMAND_STRUCT
{
    MESSAGE_RESERVED_TYPE            RESERVED;
    MESSAGE_FSS_TYPE                 FSS;
    RDC_DISCRETE_OUTPUT_COMMAND_TYPE COMMAND;
} LC_DISCRETE_OUTPUT_COMMAND_TYPE;

typedef struct LC_DISCRETE_OUTPUT_RESPONSE_STRUCT
{
    MESSAGE_RESERVED_TYPE             RESERVED;
    MESSAGE_FSS_TYPE                  FSS;
    RDC_DISCRETE_OUTPUT_RESPONSE_TYPE RESPONSE;
} LC_DISCRETE_OUTPUT_RESPONSE_TYPE;

typedef struct LC_DISCRETE_INPUT_STRUCT
{
    MESSAGE_RESERVED_TYPE   RESERVED;
    MESSAGE_FSS_TYPE        FSS;
    RDC_DISCRETE_INPUT_TYPE INPUT;
} LC_DISCRETE_INPUT_TYPE;

//#ifdef CAN_SUPPORT
typedef struct CAN_MSG_ETH_STRUCT
{
//    uint8_t frameInfo;
    uint16_t  CANID;
    uint8_t  MSG[8];
    uint16_t  LENGTH;
} CAN_MSG_ETH_TYPE;

typedef struct CAN_DISCRETE_OUTPUT_RESPONSE_STRUCT
{
    MESSAGE_RESERVED_TYPE             RESERVED;
    MESSAGE_FSS_TYPE                  FSS;
    CAN_MSG_ETH_TYPE                  CAN_MSG;
} CAN_DISCRETE_OUTPUT_RESPONSE_TYPE;

//#endif
#endif
